home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / Math Visin v2.1 disk 2.adf / Arexx.CLI / Change1.rexx < prev    next >
OS/2 REXX Batch file  |  1992-02-14  |  3KB  |  74 lines

  1. /* CHANGE1.REXX, an ARexx program for MathVision, 3-Sep-89 dh
  2.  
  3.   This generic Arexx program will allow you to create a series of pictures
  4. in contour plot mode while changing one numeric parameter.  It is assumed
  5. that you have already entered the appropriate colors and setting in
  6. Doug's Math Aquarium.
  7.  
  8.   To use this program, you must edit this file, and put in the appropriate
  9. values in the User Settings section which follows. 
  10.  
  11.   The 'BaseFilename' is the basic name which will be used for all the pictures.
  12. For example, if you put "PLOTS:PIC", the files will be named "PLOTS:PIC0000",
  13. "PLOTS:PIC0001", "PLOTS:PIC0002", and so on.  The number of the picture is 
  14. appended to the basic file name.
  15.  
  16.   'Pictures' is how many frames you want in this zoom.  A higher setting
  17. here will give you smoother animation.  The pictures will be numbered starting
  18. at 0 and going up to Pictures-1.
  19.  
  20.   It is up to you to actually use the parameter in the program to vary what
  21. you want to vary.  Put your code in the spot marked USE PARAMETER HERE.
  22. The variable 'P' is set with the value of the parameter, if you wish to 
  23. use it.
  24. */
  25.  
  26. /*============================== User Settings =============================*/
  27.  
  28. Pictures = 5            /* Number of pictures to plot */
  29. StartPicture = 0        /* Picture to resume animation at */
  30. BaseFilename = "RAM:T/Pic"    /* Basic pathname for pictures */
  31. Record = 0            /* 0 = dry run, 1 = record to disk */
  32.  
  33. ParameterStart = 0        /* start and end values for the parameter */
  34. ParameterEnd   = 1
  35. /*==========================================================================*/
  36.    
  37. ADDRESS "MathVision"    
  38. OPTIONS RESULTS            /* We need answers  */
  39. SIGNAL ON ERROR            /* go to error handler */
  40. NUMERIC DIGITS 15        /* for small things */
  41.  
  42. StopSign "F"
  43.  
  44. DO PictureNumber = StartPicture TO Pictures-1    /* for each picture...*/
  45.  
  46.   Filename = BaseFilename||Right(PictureNumber,4,"0")    /* status report */
  47.   SAY "Plotting: "Filename
  48.  
  49.   mult = (PictureNumber) / (Pictures-1)        /* 0..1 */
  50.   parameter = ParameterStart + mult*(ParameterEnd - ParameterStart)
  51.   p parameter                    /* set the variable P */
  52.  
  53.   /*======================= USE PARAMETER HERE IF NEEDED ================ */
  54.  
  55.  
  56.   /*===================================================================== */
  57.   PlotContour             /* do the appropriate plot */
  58.   Get StopSign            /* did user hit Ctrl-C ? */
  59.   IF RESULT = "T" THEN BREAK
  60.  
  61.   PathName Filename        /* set the name for this file */
  62.   IF (Record) THEN SavePicture    /* save it to disk */
  63.  
  64.   Get StopSign            /* did user hit Ctrl-C ? */
  65.   IF RESULT = "T" THEN BREAK
  66. END /* do */
  67. EXIT
  68.   
  69. ERROR:            /* Error Diagnostic for return codes */
  70.  
  71.   Get Diagnosis RC
  72.   SAY RESULT" on line "SIGL
  73.   EXIT
  74.